<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>touch与click</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"/>
		<style>
			*{
				margin: 0;
				padding: 0;
			}
			#demo{
				width: 100%;
				height: 200px;
				background-color: orange;
				font-size: 40px;
			}
		</style>
	</head>
	<body>
		<div id="demo"></div>

		<script type="text/javascript" >
			const demo = document.getElementById('demo')
			let time
			demo.ontouchstart = ()=>{
				time = Date.now()
				console.log('touchstart触发了')
			}

			demo.ontouchmove = ()=>{
				console.log('touchmove触发了')
			}

			demo.ontouchend = ()=>{
				console.log('touchend 触发了')
			}

			demo.ontouchcancel = ()=>{
				console.log('touchcancel触发了')
			}

			/* demo.onclick = ()=>{
				console.log('click触发了',Date.now()-time)
				demo.innerText = Date.now()-time
			} */
		</script>
	</body>
</html>